package com.example.pertecttime.activity.login;

import com.example.pertecttime.api.HttpMethosds;
import com.example.pertecttime.base.BaseResult;
import com.example.pertecttime.entity.User;
import com.example.pertecttime.tools.RxSchedulers;

import rx.Observable;

/**
 * Created by 半生瓜 on 2017/7/12.
 */

public class LoginModel implements loginContract.Model {

    private static LoginModel model;

    public static LoginModel getInstance() {
        if (model == null) {
            model = new LoginModel();
        }
        return model;
    }


    @Override
    public Observable<BaseResult<User>> getLoginModel(User user) {
        return HttpMethosds.getInstance().retrofitServicel
                .dologin(user)
                .compose(RxSchedulers.io_main());
    }
}
